<%@page import="member.MemberVo"%>
<%@page import="java.util.Vector"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
#list_title{}

#list_main{width:100%; background-color: #eeeecc; margin: 0 auto;}
#list_body{width:500px;}
#list_mid{display: inline-block; width: 50px; background-color:#eeeeee;} 
#list_pwd{display: inline-block; width: 50px; background-color:#eeeeee;}

.item_mid{display: inline-block; width: 50px;}
.item_pwd{display: inline-block; width: 50px;}
</style>
<script>
function getId(id){return document.getElementById(id);}

function init(){
	getId("btnFind").onclick = findFunc;
	
	getId("find").onkeyup = function(ev){
		if(ev.keyCode == 13) findFunc();
	}
}

function findFunc(){
	var find = getId("find").value;
	location.href = "index2.jsp?inc_center=./jsp/list.jsp&mid="+find;
}
</script>
</head>

<body>
<jsp:useBean id="bean" class="member.Login" scope="page" />
<jsp:setProperty property="*" name="bean"/>
<%
Vector<MemberVo> v = bean.list();

%>

<div id="list_main">
<h1>회원 현황</h1>
<label>전체 가입자 :</label><output id="memberCnt"><%=v.size()%></output><p/>
<div id="find_div">
	<input type="search" id="find" value="<%=bean.getMemberid()%>">
	<input type="button" id="btnFind" value="검색">
</div>
<br/>
<div id="list_body">
	<div id="list_title">
		<div id="list_mid">아이디</div>
		<div id="list_pwd">암호</div>
	</div>
	
	<%
	for(int i=0; i<v.size(); i++){ 
		MemberVo m = v.get(i);
	%>
	
	<div class="list_item">
		<div class="item_mid">
			<a href="index2.jsp?inc_center=./jsp/view.jsp&mid=<%=m.getMemberid()%>">
				<%=m.getMemberid() %>
			</a>
		
		</div>
		<div class="item_pwd"><%=m.getPwd() %></div>
	</div>
	<%} %>
</div>
</div>

<script>
init();
</script>

</body>
</html>